package com.songshuang.myutilsboot.stlf.util;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

public final class Base64s {
    private Base64s() {}

    public static String encode(String s) {
        if (s == null) return "";
        return Base64.getEncoder().encodeToString(s.getBytes(StandardCharsets.UTF_8));
    }

    public static String decode(String s) {
        if (s == null) return "";
        return new String(Base64.getDecoder().decode(s), StandardCharsets.UTF_8);
    }
}


